<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Open SCA: frameworks/XMLParser/src/DASParser.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.onetek.net"><img alt="Logo" src="openscaLogo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Open SCA
   &#160;<span id="projectnumber">Version 0.6.0</span>
   </div>
   <div id="projectbrief">Open SCA</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_d_a_s_parser_8cpp_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">DASParser.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_d_a_s_parser_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/***************************************************************************/</span><span class="comment">/****************************************************************************/</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#include &quot;../include/DASParser.h&quot;</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &quot;../include/debug.h&quot;</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="class_d_a_s_parser.html#afd0f39fa785a7716e919a27762693304">   25</a></span>&#160;<a class="code" href="class_d_a_s_parser.html#afd0f39fa785a7716e919a27762693304">DASParser::~DASParser</a>() {</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;}</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="class_d_a_s_parser.html#a05dd48b67436357c6a9367122ecd138e">   29</a></span>&#160;<a class="code" href="class_d_a_s_parser.html#aee14045bda078bfb9d713c32950515cc">DASParser::DASParser</a>(</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    CF::File_ptr dasFile):</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;        <a class="code" href="class_d_a_s_parser.html#a3c04372784279c2d4906203d7ba43da4">m_numElements</a>(0) {</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;        <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(4, <a class="code" href="class_d_a_s_parser.html">DASParser</a>, <span class="stringliteral">&quot;In constructor.&quot;</span>)</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;        <a class="code" href="class_d_a_s_parser.html#a121406f7c088dbf50f196fcdda500729">m_dasVar</a> = <span class="keyword">new</span> CF::DeviceAssignmentSequence;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;        <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> fileSize = dasFile-&gt;sizeOf();</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;        <a class="code" href="namespace_j_t_r_s.html#a887f798ebc040525d0b2e7dd906c6c98">CF::OctetSequence_var</a> fileData;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;        dasFile-&gt;read(fileData, fileSize);</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;        dasFile-&gt;close();</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;        <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> * fileBuffer = fileData-&gt;get_buffer();</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        <a class="code" href="class_d_a_s_parser.html#ab1533982d9916532b8fa9a8edc65b981">XMLDoc</a>.Parse((<span class="keyword">const</span> <span class="keywordtype">char</span> * )fileBuffer);</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;        <a class="code" href="class_d_a_s_parser.html#aa4bdd08e1f2e151bef204e7ec7b0ab70">root</a> = <a class="code" href="class_d_a_s_parser.html#ab1533982d9916532b8fa9a8edc65b981">XMLDoc</a>.FirstChild(<span class="stringliteral">&quot;deploymentenforcement&quot;</span>);</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;        <span class="keywordflow">if</span> (!<a class="code" href="class_d_a_s_parser.html#aa4bdd08e1f2e151bef204e7ec7b0ab70">root</a>) {</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;                std::cerr &lt;&lt; <span class="stringliteral">&quot;ERROR: Not a deployment enforcement file&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;                <span class="keywordflow">return</span>;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        }</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        TiXmlHandle docHandle(<a class="code" href="class_d_a_s_parser.html#aa4bdd08e1f2e151bef204e7ec7b0ab70">root</a>);</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        <span class="comment">// Handle device assignement sequence file</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        TiXmlElement * elem =</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;            docHandle.FirstChild(<span class="stringliteral">&quot;deviceassignmentsequence&quot;</span>).FirstChild(</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;                <span class="stringliteral">&quot;deviceassignmenttype&quot;</span>).Element();</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;        <span class="keywordflow">if</span> (!<a class="code" href="class_d_a_s_parser.html#aa4bdd08e1f2e151bef204e7ec7b0ab70">root</a>) {</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;                <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(4, <a class="code" href="class_d_a_s_parser.html">DASParser</a>, <span class="stringliteral">&quot;could not find &lt;deviceassignmentsequence&gt; node&quot;</span>)</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;                <span class="keywordflow">return</span>;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        }</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(4, <a class="code" href="class_d_a_s_parser.html">DASParser</a>, <span class="stringliteral">&quot;about to parse deviceassignment types&quot;</span>)</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        <span class="keywordflow">for</span> (; elem; elem = elem-&gt;NextSiblingElement()) {</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;                <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(4, <a class="code" href="class_d_a_s_parser.html">DASParser</a>, <span class="stringliteral">&quot;found deviceassignment type, adding element&quot;</span>)</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;                <a class="code" href="class_d_a_s_parser.html#a0ee11dad89be5f354f98c1ca16db13ce">add_element</a>();</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;                <span class="comment">// try to find &lt;componentid&gt; node</span></div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;                TiXmlElement * cid = elem-&gt;FirstChildElement(<span class="stringliteral">&quot;componentid&quot;</span>);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;                <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(4, <a class="code" href="class_d_a_s_parser.html">DASParser</a>, <span class="stringliteral">&quot;Found componentid &quot;</span> &lt;&lt; cid-&gt;GetText())</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;                <a class="code" href="class_d_a_s_parser.html#a121406f7c088dbf50f196fcdda500729">m_dasVar</a>[<a class="code" href="class_d_a_s_parser.html#a3c04372784279c2d4906203d7ba43da4">m_numElements</a> - 1].componentId = </div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;                                                        CORBA::string_dup(cid-&gt;GetText());</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;                <span class="comment">// try to find &lt;assigndeviceid&gt; node</span></div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;                TiXmlElement * adid = elem-&gt;FirstChildElement(<span class="stringliteral">&quot;assigndeviceid&quot;</span>);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;                <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(4, <a class="code" href="class_d_a_s_parser.html">DASParser</a>, <span class="stringliteral">&quot;Found assigndeviceid: &quot;</span> &lt;&lt; adid-&gt;GetText())</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;                <a class="code" href="class_d_a_s_parser.html#a121406f7c088dbf50f196fcdda500729">m_dasVar</a>[<a class="code" href="class_d_a_s_parser.html#a3c04372784279c2d4906203d7ba43da4">m_numElements</a> - 1].assignedDeviceId = </div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;                                                        CORBA::string_dup(adid-&gt;GetText());</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        }</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(4, <a class="code" href="class_d_a_s_parser.html">DASParser</a>, <span class="stringliteral">&quot;completed parsing.&quot;</span>)</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;}</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="keywordtype">void</span></div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="class_d_a_s_parser.html#a0ee11dad89be5f354f98c1ca16db13ce">   86</a></span>&#160;<a class="code" href="class_d_a_s_parser.html#a0ee11dad89be5f354f98c1ca16db13ce">DASParser::add_element</a>() {</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <a class="code" href="class_d_a_s_parser.html#a3c04372784279c2d4906203d7ba43da4">m_numElements</a>++;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        <a class="code" href="class_d_a_s_parser.html#a121406f7c088dbf50f196fcdda500729">m_dasVar</a>-&gt;length(<a class="code" href="class_d_a_s_parser.html#a3c04372784279c2d4906203d7ba43da4">m_numElements</a>);</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;}</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="class_d_a_s_parser.html#aee14045bda078bfb9d713c32950515cc">   92</a></span>&#160;<a class="code" href="class_d_a_s_parser.html#aee14045bda078bfb9d713c32950515cc">DASParser::DASParser</a>() {</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;}</div><div class="ttc" id="class_d_a_s_parser_html_aa4bdd08e1f2e151bef204e7ec7b0ab70"><div class="ttname"><a href="class_d_a_s_parser.html#aa4bdd08e1f2e151bef204e7ec7b0ab70">DASParser::root</a></div><div class="ttdeci">TiXmlNode * root</div><div class="ttdef"><b>Definition:</b> <a href="_d_a_s_parser_8h_source.html#l00043">DASParser.h:43</a></div></div>
<div class="ttc" id="namespace_j_t_r_s_html_a887f798ebc040525d0b2e7dd906c6c98"><div class="ttname"><a href="namespace_j_t_r_s.html#a887f798ebc040525d0b2e7dd906c6c98">JTRS::OctetSequence_var</a></div><div class="ttdeci">CF::OctetSequence_var OctetSequence_var</div><div class="ttdef"><b>Definition:</b> <a href="_j_t_r_s_corba_types_c_8h_source.html#l00149">JTRSCorbaTypesC.h:149</a></div></div>
<div class="ttc" id="class_d_a_s_parser_html_afd0f39fa785a7716e919a27762693304"><div class="ttname"><a href="class_d_a_s_parser.html#afd0f39fa785a7716e919a27762693304">DASParser::~DASParser</a></div><div class="ttdeci">virtual ~DASParser()</div><div class="ttdef"><b>Definition:</b> <a href="_d_a_s_parser_8cpp_source.html#l00025">DASParser.cpp:25</a></div></div>
<div class="ttc" id="class_d_a_s_parser_html"><div class="ttname"><a href="class_d_a_s_parser.html">DASParser</a></div><div class="ttdef"><b>Definition:</b> <a href="_d_a_s_parser_8h_source.html#l00029">DASParser.h:29</a></div></div>
<div class="ttc" id="debug_8h_html_a4036580c4cea6cf404647d18f2fe3452"><div class="ttname"><a href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a></div><div class="ttdeci">#define DEBUG(level, title, debuginfo)</div><div class="ttdef"><b>Definition:</b> <a href="debug_8h_source.html#l00055">debug.h:55</a></div></div>
<div class="ttc" id="class_d_a_s_parser_html_ab1533982d9916532b8fa9a8edc65b981"><div class="ttname"><a href="class_d_a_s_parser.html#ab1533982d9916532b8fa9a8edc65b981">DASParser::XMLDoc</a></div><div class="ttdeci">TiXmlDocument XMLDoc</div><div class="ttdef"><b>Definition:</b> <a href="_d_a_s_parser_8h_source.html#l00044">DASParser.h:44</a></div></div>
<div class="ttc" id="class_d_a_s_parser_html_a0ee11dad89be5f354f98c1ca16db13ce"><div class="ttname"><a href="class_d_a_s_parser.html#a0ee11dad89be5f354f98c1ca16db13ce">DASParser::add_element</a></div><div class="ttdeci">void add_element()</div><div class="ttdef"><b>Definition:</b> <a href="_d_a_s_parser_8cpp_source.html#l00086">DASParser.cpp:86</a></div></div>
<div class="ttc" id="class_d_a_s_parser_html_a3c04372784279c2d4906203d7ba43da4"><div class="ttname"><a href="class_d_a_s_parser.html#a3c04372784279c2d4906203d7ba43da4">DASParser::m_numElements</a></div><div class="ttdeci">unsigned int m_numElements</div><div class="ttdef"><b>Definition:</b> <a href="_d_a_s_parser_8h_source.html#l00048">DASParser.h:48</a></div></div>
<div class="ttc" id="class_d_a_s_parser_html_a121406f7c088dbf50f196fcdda500729"><div class="ttname"><a href="class_d_a_s_parser.html#a121406f7c088dbf50f196fcdda500729">DASParser::m_dasVar</a></div><div class="ttdeci">CF::DeviceAssignmentSequence_var m_dasVar</div><div class="ttdef"><b>Definition:</b> <a href="_d_a_s_parser_8h_source.html#l00047">DASParser.h:47</a></div></div>
<div class="ttc" id="class_d_a_s_parser_html_aee14045bda078bfb9d713c32950515cc"><div class="ttname"><a href="class_d_a_s_parser.html#aee14045bda078bfb9d713c32950515cc">DASParser::DASParser</a></div><div class="ttdeci">DASParser()</div><div class="ttdef"><b>Definition:</b> <a href="_d_a_s_parser_8cpp_source.html#l00092">DASParser.cpp:92</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.13-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_27e7b6da28153e106312658788f622d3.html">frameworks</a></li><li class="navelem"><a class="el" href="dir_82d23cf221d390315bcc70b79c1eb009.html">XMLParser</a></li><li class="navelem"><a class="el" href="dir_c1c25090ae799792e746c4a64078dc3c.html">src</a></li><li class="navelem"><a class="el" href="_d_a_s_parser_8cpp.html">DASParser.cpp</a></li>
    <li class="footer">Generated on Fri Jul 12 2019 14:31:53 for
    <a href="http://www.onetek.net">
    <img class="footer" src="openscaLogo.png" height="31" alt="openSCA"/></a>
    </li>
  </ul>
</div>
</body>
</html>
